Documentation for Users  1.0.2
Perception Toolbox for Virtual Reality (PTVR) Manual
Simplified Interactions

In some special cases, PTVR provides simplified interactions, i.e. ways to avoid creating standard interactions relying on explicit interactions between Events and Callbacks.

These simplified interactions are rare in PTVR: they are only meant to reduce code length in very special cases as presented below.

Control of Scene duration

When you want to control the duration of a scene, you can do it by using the special class SimplifiedTimerScene (instead of the class Scene plus an interaction) with one line of code as shown below:

my_scene = PTVR.Stimuli.Scenes.SimplifiedTimerScene ( scene_duration_in_ms = 1000)

This simplified code above does the same as the standard code below :

my_scene = PTVR.Stimuli.Scenes.VisualScene ()
my_Event_Timer = Event.Timer (delay_in_ms = 1000)
my_Callback = Callback.EndCurrentScene ()
my_scene.AddInteraction ( Events = [my_Event_Timer], Callbacks = [my_Callback] )

Demos

Python file

Description

...\PTVR_Researchers\Python_Scripts\Demos\Scenes\ 1_one_scene_w_simplified_duration.py

Creates a scene whose duration is controlled by using the SimplifiedTimerScene class.

...\PTVR_Researchers\Python_Scripts\Demos\Scenes\ 2_one_scene_w_NON_simplified_duration.py

Creates a scene whose duration is controlled by using a standard interaction between an Event and an Callback.

...\PTVR_Researchers\Python_Scripts\Demos\Objects\ 3_rotation_animated_about_one_axis.py

Animated rotation of a cube with a succession of scenes each being controlled in duration by the SimplifiedTimerScene class.